﻿using System;
using System.Collections.Generic;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GzipManagerPro.IO.Helpers;

namespace GzipManagerPro.IO
{
    [Serializable]
    public partial class File: ArchiveItem
    {
        
        private long _Length;

        [NonSerialized]
        private string _FullPath;

        private long _Offset;


        public long Length
        {
            get
            {
                return _Length;
            }
            set
            {
                _Length = value;
            }
        }

        public string FullPath
        {
            get
            {
                return _FullPath;
            }
            set
            {
                _FullPath = value;
            }
        }

        public long Offset
        {
            get
            {
                return _Offset;
            }
            set
            {
                _Offset = value;
            }
        }

        public static File FromPath(string path)
        {
            if (!System.IO.File.Exists(path))
                throw new System.IO.FileNotFoundException();

            File file = new File()
            {
                Name = System.IO.Path.GetFileName(path),
                FullPath = path
            };

            return file;
        }

        
    }
}
